package com.itheima.sort;

public class A04_Recursion {
    public static void main(String[] args) {
        //求1~100的和
        int number = 100;

        int sum = getSumRecursion(100);
        System.out.println(sum);

    }

    private static int getSumRecursion(int i) {
        if(i==1){
            return 1;
        }
       return i + getSumRecursion(i-1);
    }
}
